
<table>
  <tr>
    <th>顺序</th>
    <th>图片</th>
    <th>图片大小</th>
    <th>排序</th>
    <th>操作</th>

  </tr>

  <%  @article.article_images.each do |i| %>
    <tr>
      <td><%=h i.sort %></td>
      <td><%=image_tag i.image.url ,:size=>"60x60" %></td>
      <td><%=h "#{(i.image_file_size/(1024.0*1024.0)).to_s[0..5]}M(兆)" %></td>
      <td>
        <%= link_to_remote((image_tag "/images/sort_up.jpg" ,:size => "10x15"),
          :url=>product_image_sort_ajax_path(:product_id=>@article.id ,:product_image_id => i.id,:sort => "up"),:method => :get,:before => "disabled_page('true');",:complete => "disabled_page('false');")%>
        <%= link_to_remote((image_tag "/images/sort_down.jpg",:size => "10x15"),
          :url=>product_image_sort_ajax_path(:product_id=>@article.id, :product_image_id =>i.id,:sort => "down"),:method => :get,:before => "disabled_page('true');",:complete => "disabled_page('false');") %>
      </td>
      <td><%= link_to 'Destroy', admin_admin_article_image_path(i,:product_id=>@article.id), :confirm => 'Are you sure?', :method => :delete %></td>
    </tr>
  <%end%>
</table>


<table class="table">
        <tr class="odd">
      <td width="60px">分类</td>
      <td width="200px">  <%=h @article.category.name %></td>
    </tr>
        <tr class="odd">
      <td width="60px">添加用户</td>
      <td width="200px">  <%=h @article.user.name %></td>
    </tr>
     
    <tr class="odd">
      <td width="60px">标题</td>
      <td width="200px">   <%=h @article.title %></td>
    </tr>
    <tr class="odd">
      <td width="60px">副标题</td>
      <td width="200px">    <%=h @article.subhead %></td>
    </tr>
    <tr class="odd">
      <td width="60px">来源</td>
      <td width="200px">    <%=h @article.from %></td>
    </tr>
        <tr class="odd">
      <td width="60px">作者</td>
      <td width="200px">   <%=h @article.author %></td>
    </tr>
            <tr class="odd">
      <td width="60px">摘要</td>
      <td width="200px">   <%=h @article.summary %></td>
    </tr>
                <tr class="odd">
      <td width="60px">内容</td>
      <td width="200px">   <%=h @article.body %></td>
    </tr>
</table>
<table class="table">
    <tr>
    <th>回复内容</th>
    <th>回复IP</th>
    <th>回复用户</th>
    </tr>
  <%  @article_comments.each do |comment|%>
    <tr class="odd">
      <td width="200px"><%=h comment.content %></td>
      <td width="60px">   <%=h comment.ipaddr %></td>
      <td width="200px">   <%=h comment.try(:user).try(:name) %></td>
    </tr>
  <% end %>

</table>
<%= will_paginate @article_comments  %>


<%= link_to '编辑', edit_admin_admin_article_path(@article) %> |
<%= link_to '返回', admin_admin_articles_path %>